﻿using Microsoft.IdentityModel.Tokens;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Daemon.Common.Auth
{
    public class JwtOptions
    {
        public const string Name = "Jwt";
        public readonly static Encoding DefaultEncoding = Encoding.UTF8;
        public readonly static double DefaultExpiresMinutes = 30d;
        private readonly static double DefaultExpiresDays = 1d;

        public string Audience { get; set; }

        public string Issuer { get; set; }

        public string Secret { get; set; }

        public double AccessTokenExpiresMinutes { get; set; } = DefaultExpiresMinutes;

        public double RefreshTokenExpiresDays { get; set; } = DefaultExpiresDays;

        public Encoding Encoding { get; set; } = DefaultEncoding;

        public string SymmetricSecurityKeyString { get; set; }

        //public SymmetricSecurityKey SymmetricSecurityKey => new(Encoding.GetBytes(SymmetricSecurityKeyString));
    }
}
